<%-- 
    Document   : post-update
    Created on : 27-02-2012, 21:55:10
    Author     : NHAN
--%>


<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fck" uri="http://java.fckeditor.net" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../handler/post-update-action.jsp" %>
        <h1>Post update</h1>
        <form action="#" method="post">
            <table class="form-table fullWidth">
                <tr>
                    <td>Title:</td>
                    <td><input type="text" name="title" id="title" value="${post.title}"/></td>
                    <td></td>
                </tr>
                <tr>
                    <td>Content: </td>
                    <td><fck:editor instanceName="defaultEditor" toolbarSet="Default" inputName="content" value="${post.content}"  /> </td>
                    <td></td>
                </tr>
                <tr>
                    <td>Category: </td>
                    <td>
                        <select name="category">
                            <c:forEach var="cate" items="${cateList}">
                            <option value="${cate.id}" ${cate.parentId==post.category.id?'selected':''}>${cate.name}</option>
                            </c:forEach>
                        </select>
                    </td>
                    <td></td>
                </tr>               
                <tr>
                    <td>Public:</td>
                    <td><input type="checkbox" name="is-public" ${post.state?' checked':''}/></td>
                    <td></td>
                </tr>              

                <tr>
                    <td></td>
                    <td><input type="submit" name="update" value="Save changes"/></td>
                    <td></td>
                </tr>
            </table>
        </form>
        <form action="#" method="post">            
            <div class="confirm-box">
                <div>Are you sure want to continue?</div>
                <input type="button" name="delete" value="Delete" onclick="remove();"/>
                <input type="button" name="hide" value="Cancel" onclick="hideConfirm();"/>
            </div>
            <input type="hidden" name="postid" value="${post.id}"/>
        </form>

